import {
	http
} from '@/js_sdk/luch-request/index.js' // 全局挂载引入，配置相关在该index.js文件里修改 

import config from "@/config/index.config.js";
// --------------------------------------------------------------- 
// 登录
export const procuratorLogin = (data) => http.post('admin/login', data);
export const getOpenId = (data) => http.post('admin/getOpenId', data);
// 新增一周一巡查
export const weekCheckAdd = (data) => http.post('weekCheck/add', data);
// 一周一巡查列表
export const weekCheckList = (params) => http.get('weekCheck/list', {params});
export const weekCheckDesc = (id) => http.get(`weekCheck/getDetail?id=${id}`);
// 专项巡查
export const specialCheckList = (params) => http.get(`specialCheck/list`, {params});
export const specialCheckAdd = (data) => http.post(`specialCheck/add`, data);
export const specialCheckDesc = (id) => http.get(`specialCheck/getDetail?id=${id}`);
// 线索反馈 
export const clueList = (params) => http.get(`clue/list`, {params});
export const clueAdd = (data) => http.post(`clue/add`, data);
export const clueDesc = (id) => http.get(`clue/getDetail?id=${id}`);
export const listDesc = (id) => http.get(`warningEvent/getDetailsById?id=${id}`);
// 线索反馈 办结
export const clueDeal = (data) => http.post('clue/deal', data);
// 线索反馈 流转
export const clueTransfer = (data) => http.post(`clue/transfer`, data);

//民警首页list
export const getIndexLIst = (data) => http.post('warningEvent/getDetailsByName', data);

//任务下派新增
export const addrenwuXp = (data) => http.post('warningEvent/save', data);

//任务下派-下派至下拉数据
export const completionData = (data) => http.post('warningEvent/findNextLevel', data);

//是否有任务待接收
export const taskToBeReceived = () => http.get('warningEvent/getNotReceive');

//流转
export const wanderAbout = (data) => http.post('warningEvent/batchEventUpdate', data);

// 驳回
export const rejectEvent = (data) => http.post('warningEvent/turnDown?id=' + data.id + '&bak=' + data.bak);

// 办结反馈
export const getBatchUpdate = (data) => http.post('warningEvent/batchUpdate', data);



// 外出申请
export const outward = (data) => http.post('api/punch/outward', data);
// 外出审批
export const approve = (data) => http.post('api/punch/approve', data);
// 打卡列表
export const managerPunchList = (params) => http.get('api/punch/managerPunchList', {
	params
})
// 我的审批列表
export const approveList = (params) => http.get('api/punch/approveList', {
	params
})
// 审批列表
export const managerApproveList = (params) => http.get('api/punch/managerApproveList', {
	params
})
// 首页打卡记录
export const dayPunchList = (params) => http.get('api/punch/dayPunchList', {
	params
})
// 打卡申请
export const punch = (data) => http.post('api/punch/punch', data);
// 首页判断是否可以打卡
export const punchBaseInfo = (params) => http.get('api/punch/punchBaseInfo', {
	params
})
//打卡详情打卡记录
export const punchList = (params) => http.get('api/punch/punchList', {
	params
})
//更新个人信息 
export const updateProfile = (data) => http.put('api/punch/updateProfile', data);
//部门列表
export const deptList = (params) => http.get('api/punch/deptList', {
	params
})
//图片访问路径 
export const filePath = (params) => http.get('api/punch/filePath', {
	params
})
// 图片上传路径
export const uploadPic = (data) => http.post('api/punch/uploadPic', data);
//用户基本信息
export const userInfo = (params) => http.get('api/punch/userInfo', {
	params
});
//通讯录列表 
export const userList = (params) => http.get('api/punch/userList', {
	params
});
//打卡列表   
export const getClockList = (params) => http.get('api/punch/dk/list', {
	params
}); 
// 获取手机号
export const punchCheckPhone = (params) => http.get('api/punch/punchCheckPhone', {
	params
});  
// 获取行政区划
export const getCityRegion = (params) => { // 获取行政区划
  return new Promise((resolve, reject) => {
    let _url = 'https://apis.map.qq.com/ws/district/v1/search/' 
    if (!params.key) {
      params.key = config.qqmapKey  
    }
	console.log(params,"paramsparamsparams")
    uni.request({
      url: _url,
      type: 'get',
      data: params,
      success: function(res) {
		  console.log(res,"resresresresres")
        if (res.statusCode == 200) {
          resolve(res.data)
        } else {
          reject(res.errMsg)
        }
      },
      fail: function(err) {
        reject(err)
      }
    })
  })
}